#ifndef __PD_UFP_LOG_H__
#define __PD_UFG_LOG_H__
#include "stdint.h"
typedef struct
{
    uint16_t time;
    uint16_t msg_header;
    uint8_t obj_count;
    uint8_t status;
} status_log_t;

typedef enum
{
    PD_LOG_LEVEL_INFO,
    PD_LOG_LEVEL_VERBOSE
} pd_log_level_t;
enum
{
    STATUS_LOG_MSG_TX,
    STATUS_LOG_MSG_RX,
    STATUS_LOG_DEV,
    STATUS_LOG_CC,
    STATUS_LOG_SRC_CAP,
    STATUS_LOG_POWER_READY,
    STATUS_LOG_POWER_PPS_STARTUP,
    STATUS_LOG_POWER_REJECT,
    STATUS_LOG_LOAD_SW_ON,
    STATUS_LOG_LOAD_SW_OFF,
};

void pu_log_init(pd_log_level_t log_level);
uint8_t pu_status_log_obj_add(uint16_t header, uint32_t *obj);
void pu_status_log_event(uint8_t status, uint32_t *obj);
int pu_status_log_readline_msg(char *buffer, int maxlen, status_log_t *log);
int pu_status_log_readline_src_cap(char *buffer, int maxlen);
int pu_status_log_readline(char *buffer, int maxlen);
void pu_print_status(void);
#endif
